﻿using Prism.Events;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;

namespace Core.Tools.IOC
{
    [ExposedService(Lifttime.Singleton, AutoInitialize = true)]
    public sealed class PrismProvider
    {
        public static IContainerExtension Container { get; private set; }
        public static IRegionManager RegionManager { get; private set; }
        public static IDialogService DialogService { get; private set; }
        public static IEventAggregator EventAggregator { get; private set; }
        public static IModuleManager ModuleManager { get; private set; }
        public static Dispatcher Dispatcher { get; private set; }
        public static Window MainWindow { get; private set; }
        public PrismProvider(IContainerExtension container,
            IRegionManager regionManager,
            IDialogService dialogService,
            IEventAggregator eventAggregator,
            IModuleManager moduleManager)
        {
            Container = container; ;
            RegionManager = regionManager;
            DialogService = dialogService;
            EventAggregator = eventAggregator;
            ModuleManager = moduleManager;
            Dispatcher = System.Windows.Application.Current.Dispatcher;
            MainWindow = System.Windows.Application.Current.MainWindow;
        }
    }
}
